import jdk.swing.interop.SwingInterOpUtils;

public class Demo3 {
    private static boolean isQuite=false;
    public static void main(String[] args) throws InterruptedException {
        Thread t1=new Thread(()->{
            while (!isQuite){
                System.out.println("Hello t1");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

            System.out.println("线程t1结束");
        });
        t1.start();
        Thread.sleep(3000);
        System.out.println("main线程尝试结束t1线程");
        isQuite=true;
    }
}
